package com.yc.video.model;


import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@SuppressWarnings("serial")
@Entity
@Table(name = "t_s_user")
@org.hibernate.annotations.Table(appliesTo = "t_s_user", comment = "用户信息表")
public class TSUser extends IdEntity implements Serializable {

	/*@Column(columnDefinition = "varchar(500) DEFAULT NULL COMMENT '设备名称'")
	@Column(columnDefinition = "int default 0 comment '排序字段'")
	private int odr;

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Temporal(TemporalType.TIMESTAMP)
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@Column(columnDefinition = "datetime DEFAULT NULL COMMENT '创建时间'")
	private Date buildtime;*/

	private String username;// 用户名，账号
	private String password;//密码
	private String faceImage;//我的头像，如果没有默认给一张
	private String faceImageBig;//我的大头像
	private String nickname;//昵称
	private String qrcode;//新用户注册后默认后台生成二维码，并且上传
	private String cid;  //手机cid
	private Date createDateTime;


	@Column(columnDefinition = "varchar(32) NOT NULL UNIQUE COMMENT '用户名'")
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(columnDefinition = "varchar(100) NOT NULL COMMENT '密码'")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(columnDefinition = "varchar(255) DEFAULT NULL COMMENT '头像'")
	public String getFaceImage() {
		return faceImage;
	}

	public void setFaceImage(String faceImage) {
		this.faceImage = faceImage;
	}

	@Column(columnDefinition = "varchar(255) DEFAULT NULL COMMENT '大头像'")
	public String getFaceImageBig() {
		return faceImageBig;
	}

	public void setFaceImageBig(String faceImageBig) {
		this.faceImageBig = faceImageBig;
	}

	@Column(columnDefinition = "varchar(32) DEFAULT NULL COMMENT '昵称'")
	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	@Column(columnDefinition = "varchar(255) DEFAULT NULL COMMENT '二维码'")
	public String getQrcode() {
		return qrcode;
	}

	public void setQrcode(String qrcode) {
		this.qrcode = qrcode;
	}

	@Column(columnDefinition = "varchar(32) DEFAULT NULL COMMENT '手机cid'")
	public String getCid() {
		return cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Temporal(TemporalType.TIMESTAMP)
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@Column(columnDefinition = "createdatetime NOT NULL COMMENT '创建的时间'")
	public Date getCreateDateTime() {
		return createDateTime;
	}

	public void setCreateDateTime(Date createDateTime) {
		this.createDateTime = createDateTime;
	}

	public TSUser() {
	}

	@Override
	public String toString() {
		return "TSUser{" +
				"username='" + username + '\'' +
				", password='" + password + '\'' +
				", faceImage='" + faceImage + '\'' +
				", faceImageBig='" + faceImageBig + '\'' +
				", nickname='" + nickname + '\'' +
				", qrcode='" + qrcode + '\'' +
				", cid='" + cid + '\'' +
				'}';
	}
}
